Expand description
This crate contains Bevy’s UI system, which can be used to create UI for both 2D and 3D games
Basic usage
Spawn UI elements with node_bundles::ButtonBundle
, node_bundles::ImageBundle
, [node_bundles::TextBundle
] and node_bundles::NodeBundle
This UI is laid out with the Flexbox and CSS Grid layout models (see https://cssreference.io/flexbox/)
Re-exports
pub use measurement::*;
Modules
- Configuration for cameras related to UI.
- This module contains basic node bundles used to build UIs
- This module contains systems that update the UI when something changes
- This module contains the basic building blocks of Bevy’s UI
Structs
- The background color of the node
- The border color of the UI node.
- The calculated clip of the node
- Represents the position of a grid item in a single axis.
- A
GridTrack
is a Row or Column of a CSS Grid. This struct specifies what size the track should be. See below for the different “track sizing functions” you can specify. - Describes the size of a UI node
- Main query for
ui_focus_system
- Automatically generated
WorldQuery
item type forNodeQuery
, returned when iterating over query results. - Automatically generated
WorldQuery
type for a read-only variant ofNodeQuery
. - Automatically generated
WorldQuery
item type forNodeQueryReadOnly
, returned when iterating over query results. - Whether to show or hide overflowing items
- A component storing the position of the mouse relative to the node, (0., 0.) being the top-left corner and (1., 1.) being the bottom-right If the mouse is not over the node, the value will go beyond the range of (0., 0.) to (1., 1.) A None value means that the cursor position is unknown.
- Represents a possibly repeated
GridTrack
. - Describes the style of a UI container node
- The 2D texture displayed for this UI node
- The basic plugin for Bevy UI
- A type which is commonly used to define margins, paddings and borders.
- The current scale of the UI.
- The current UI stack, which contains all UI nodes ordered by their depth (back-to-front).
- The atlas sprite to be used in a UI Texture Atlas Node
Enums
- Defines how each line is aligned within the flexbox.
- How items are aligned according to the cross axis
- How this item is aligned according to the cross axis. Overrides
AlignItems
. - Defines the text direction
- Whether to use a Flexbox layout model.
- Defines how flexbox items are ordered within a flexbox
- Defines if flexbox items appear on a single line or on multiple lines
- Describes whether the node should block interactions with lower nodes
- Controls whether grid items are placed row-wise or column-wise. And whether the sparse or dense packing algorithm is used.
- How many times to repeat a repeated grid track
- Describes what type of input interaction has occurred for a UI node.
- Defines how items are aligned according to the main axis
- How items are aligned according to the cross axis
- How this item is aligned according to the cross axis. Overrides
AlignItems
. - Whether to show or hide overflowing items
- The strategy used to position this node
- The label enum labeling the types of systems in the Bevy UI
- Represents the possible value types for layout properties.
- Indicates that this
Node
entity’s front-to-back ordering is not controlled solely by its location in the UI hierarchy. A node with a higher z-index will appear on top of other nodes with a lower z-index.
Constants
Functions
- The system that sets Interaction for all UI elements based on the mouse cursor activity
- Updates the UI’s layout tree, computes the new layout geometry and then updates the sizes and transforms of all the UI nodes.